using System;
using System.Collections.Generic;
using System.Text;

namespace WebCrawlerTools.search
{
    public class PageEngine
    {
        private String source;
        private SResult sResult;
        private STemplate sTemplate;
        public String Source
        {
            get { return source; }
            set { source = value; }
        }

        public WebCrawlerTools.STemplate Template
        {
            get
            {
                return sTemplate;
            }
            set
            {
                sTemplate = value;
            }
        }

        public SResult Result
        {
            get
            {
                return sResult;
            }
            set
            {
                sResult = value;
            }
        }
    
        public void analysis()
        {
            Result = new SResult();
            Result.Title = sTemplate.getTitle();

            SPart sPart = new SPart(this);
            int startPos = 0;
            while (sPart.FindPart(startPos))
            {
                Result.Data.Add(sPart.getValues());
                startPos = sPart.EndPos + 1;
            }
        }
    }
}
